# -*- coding: UTF-8 -*-
# @Time : 2022/1/5 0005 9:09
# @Author : lyw
# @Remark : 烟感
from mxsoftpy import View
from index import _
from server.common.IOTManager.GasDetector.gas_detector import GASDeviceSelectServer, GASDeviceListServer, \
    GASDeviceRetrieveServer
from utils.public.params_method import check_params


class GASADeviceSelectView(View):

    def post(self):
        return _("查询成功"), GASDeviceSelectServer().select(**self.request.POST)


class GASDeviceListView(View):

    def post(self):
        return _("查询成功"), GASDeviceListServer().select()


class GASDeviceRetrieveView(View):

    def post(self):
        check_params(self.request.POST, ["code"])
        return _("查询成功"), GASDeviceRetrieveServer().select(**self.request.POST)
